﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using Models;

namespace DAL
{
    public class comremarkService
    {
        public SqlDataReader get(string id)
        {
            //string sql = "select pic,proname,speci,price from product where id=" + id;
            string sql=string.Format("select pic,proname,speci,price,id from product where id in(select proid from pay where batch ='{0}')",id);
            return DBhelper.DataReader(sql);
        }
        public bool upd(string bh)
        {
            string sql = "update [order] set state=4 where orders='"+bh+"'";
            return DBhelper.ex(sql);
        }
        public bool add(Remark re)
        {
            //新增方法
            string sql = string.Format("insert remark values('{0}','{1}','{2}','{3}','{4}')",re.Username,re.Datenow,re.Cont,re.Userid,re.Proid);
            //string sql = string.Format("insert collect values('{0}','{1}','{2}')", collect.Userid, collect.Storeid, collect.Proid);
            return DBhelper.ex(sql);
        }
    }
}
